package com.buss.purchase.model;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

import com.buss.product.model.GoodsDetail;

/**
 * 采购退货明细
 * @author gykl
 *
 */
@Entity
@Table(name = "purchase_returndetail")
@TableGenerator(name="pcReturnDetail_pk_sequence",initialValue=1,allocationSize=1,pkColumnName="seq_col",
pkColumnValue="returndetail_seq",valueColumnName="seq_val",table="purchase_pk_sequence")
public class PurchaseReturnDetail implements Serializable {

	private static final long serialVersionUID = 8224726742914718409L;

	/**表主键*/
	@Id
	@GeneratedValue(strategy=GenerationType.TABLE,generator="pcReturnDetail_pk_sequence")
	private Long id;
	
	/**退货单号*/
	@Column(nullable=false)
	private Long masterId;
	
	/**商品信息*/
	@ManyToOne(cascade=CascadeType.REFRESH,optional=false)
	@JoinColumn(name="goodsId",nullable=false)
	private GoodsDetail goods;
	
	/**数量*/
	@Column(nullable=false,scale=2)
	private Float quantity;
	
	/**单价(不含税)*/
	@Column(nullable=false,scale=2)
	private Float price;
	
	/**折扣率*/
	@Column(nullable=false,scale=2)
	private Float discountRate;
	
	/**税率*/
	@Column(nullable=false,scale=2)
	private Float taxRate;
	
	/**备注*/
	@Column(length=254)
	private String intro;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getMasterId() {
		return masterId;
	}

	public void setMasterId(Long masterId) {
		this.masterId = masterId;
	}

	public GoodsDetail getGoods() {
		return goods;
	}

	public void setGoods(GoodsDetail goods) {
		this.goods = goods;
	}

	public Float getQuantity() {
		return quantity;
	}

	public void setQuantity(Float quantity) {
		this.quantity = quantity;
	}

	public Float getPrice() {
		return price;
	}

	public void setPrice(Float price) {
		this.price = price;
	}

	public Float getDiscountRate() {
		return discountRate;
	}

	public void setDiscountRate(Float discountRate) {
		this.discountRate = discountRate;
	}

	public Float getTaxRate() {
		return taxRate;
	}

	public void setTaxRate(Float taxRate) {
		this.taxRate = taxRate;
	}

	public String getIntro() {
		return intro;
	}

	public void setIntro(String intro) {
		this.intro = intro;
	}
	
}
